package com.gitee.wsl.ext.math

object LevelExt {

    const val DEFAULT_LEVEL_STR = "C"
    const val DEFAULT_LEVEL = 5

    fun getNextOverallScore(current:String): String {
        return when (current) {
            "A+" -> "A+"
            "A" -> "A+"
            "A-" -> "A"
            "B+" -> "A-"
            "B" -> "B+"
            "B-" -> "B"
            "C+" -> "B-"
            "C" -> "C+"
            "C-" -> "C"
            "D+" -> "C-"
            "D" -> "D+"
            "D-" -> "D"
            else -> ""
        }
    }

    fun getPreviousOverallScore(current:String): String {
        return when (current) {
            "A+" -> "A"
            "A" -> "A-"
            "A-" -> "B+"
            "B+" -> "B"
            "B" -> "B-"
            "B-" -> "C+"
            "C+" -> "C"
            "C" -> "C-"
            "C-" -> "D+"
            "D+" -> "D"
            "D" -> "D-"
            "D-" -> "D-"
            else -> ""
        }
    }

    fun convertScoreToChartValue(current: String): Int {
        return when (current) {
            "D-" -> 1
            "D" -> 2
            "D+" -> 3
            "C-" -> 4
            "C" -> 5
            "C+" -> 6
            "B-" -> 7
            "B" -> 8
            "B+" -> 9
            "A-" -> 10
            "A" -> 11
            "A+" -> 12
            else -> 0
        }
    }

    fun convertToChartScore(current:Int): String {
        return when (current) {
            1 -> "D-"
            2 -> "D"
            3 -> "D+"
            4 -> "C-"
            5 -> "C"
            6 -> "C+"
            7 -> "B-"
            8 -> "B"
            9 -> "B+"
            10 -> "A-"
            11 -> "A"
            12 -> "A+"
            else -> "0"
        }
    }
}